home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / c / inet.man < prev    next >
Encoding:
Text File  |  1989-04-20  |  4.6 KB  |  133 lines

  1.  
  2.  
  3.  
  4. INET                  C Library Procedures                   INET
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      inet_addr, inet_network, inet_ntoa, inet_makeaddr,
  10.      inet_lnaof, inet_netof - Internet address manipulation rou-
  11.      tines
  12.  
  13. SSYYNNOOPPSSIISS
  14.      ##iinncclluuddee <<ssyyss//ssoocckkeett..hh>>
  15.      ##iinncclluuddee <<nneettiinneett//iinn..hh>>
  16.      ##iinncclluuddee <<aarrppaa//iinneett..hh>>
  17.  
  18.      uunnssiiggnneedd lloonngg iinneett__aaddddrr((ccpp))
  19.      cchhaarr **ccpp;;
  20.  
  21.      uunnssiiggnneedd lloonngg iinneett__nneettwwoorrkk((ccpp))
  22.      cchhaarr **ccpp;;
  23.  
  24.      cchhaarr **iinneett__nnttooaa((iinn))
  25.      ssttrruucctt iinn__aaddddrr iinn;;
  26.  
  27.      ssttrruucctt iinn__aaddddrr iinneett__mmaakkeeaaddddrr((nneett,, llnnaa))
  28.      iinntt nneett,, llnnaa;;
  29.  
  30.      uunnssiiggnneedd lloonngg iinneett__llnnaaooff((iinn))
  31.      ssttrruucctt iinn__aaddddrr iinn;;
  32.  
  33.      uunnssiiggnneedd lloonngg iinneett__nneettooff((iinn))
  34.      ssttrruucctt iinn__aaddddrr iinn;;
  35.  
  36. DDEESSCCRRIIPPTTIIOONN
  37.      The routines _i_n_e_t__a_d_d_r and _i_n_e_t__n_e_t_w_o_r_k each interpret char-
  38.      acter strings representing numbers expressed in the Internet
  39.      standard "." notation, returning numbers suitable for use as
  40.      Internet addresses and Internet network numbers, respec-
  41.      tively.  The routine _i_n_e_t__n_t_o_a takes an Internet address and
  42.      returns an ASCII string representing the address in "."
  43.      notation.  The routine _i_n_e_t__m_a_k_e_a_d_d_r takes an Internet net-
  44.      work number and a local network address and constructs an
  45.      Internet address from it.  The routines _i_n_e_t__n_e_t_o_f and
  46.      _i_n_e_t__l_n_a_o_f break apart Internet host addresses, returning
  47.      the network number and local network address part, respec-
  48.      tively.
  49.  
  50.      All Internet address are returned in network order (bytes
  51.      ordered from left to right).  All network numbers and local
  52.      address parts are returned as machine format integer values.
  53.  
  54. IINNTTEERRNNEETT AADDDDRREESSSSEESS
  55.      Values specified using the "." notation take one of the fol-
  56.      lowing forms:
  57.           a.b.c.d
  58.           a.b.c
  59.           a.b
  60.  
  61.  
  62.  
  63. Sprite v1.0              October 1, 1987                        1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. INET                  C Library Procedures                   INET
  71.  
  72.  
  73.  
  74.           a
  75.      When four parts are specified, each is interpreted as a byte
  76.      of data and assigned, from left to right, to the four bytes
  77.      of an Internet address.  Note that when an Internet address
  78.      is viewed as a 32-bit integer quantity on the VAX the bytes
  79.      referred to above appear as "d.c.b.a".  That is, VAX bytes
  80.      are ordered from right to left.
  81.  
  82.      When a three part address is specified, the last part is
  83.      interpreted as a 16-bit quantity and placed in the right
  84.      most two bytes of the network address.  This makes the three
  85.      part address format convenient for specifying Class B net-
  86.      work addresses as "128.net.host".
  87.  
  88.      When a two part address is supplied, the last part is inter-
  89.      preted as a 24-bit quantity and placed in the right most
  90.      three bytes of the network address.  This makes the two part
  91.      address format convenient for specifying Class A network
  92.      addresses as "net.host".
  93.  
  94.      When only one part is given, the value is stored directly in
  95.      the network address without any byte rearrangement.
  96.  
  97.      All numbers supplied as "parts" in a "." notation may be
  98.      decimal, octal, or hexadecimal, as specified in the C
  99.      language (i.e., a leading 0x or 0X implies hexadecimal; oth-
  100.      erwise, a leading 0 implies octal; otherwise, the number is
  101.      interpreted as decimal).
  102.  
  103. SSEEEE AALLSSOO
  104.      gethostbyname(3N), getnetent(3N), hosts(5), networks(5),
  105.  
  106. DDIIAAGGNNOOSSTTIICCSS
  107.      The constant IINNAADDDDRR__NNOONNEE is returned by _i_n_e_t__a_d_d_r and
  108.      _i_n_e_t__n_e_t_w_o_r_k for malformed requests.
  109.  
  110. BBUUGGSS
  111.      The problem of host byte ordering versus network byte order-
  112.      ing is confusing.  A simple way to specify Class C network
  113.      addresses in a manner similar to that for Class B and Class
  114.      A is needed.  The string returned by _i_n_e_t__n_t_o_a resides in a
  115.      static memory area.
  116.      Inet_addr should return a struct in_addr.
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129. Sprite v1.0              October 1, 1987                        2
  130.  
  131.  
  132.  
  133.